package server.impl;

import interfaces.Publisher;
import interfaces.Subscriber;
import interfaces.impl.PublisherImpl;
import operations.Operation;
import accessers.DataWriter;
import accessers.impl.DataWriterImpl;
import server.ClientRemote;

public class ClientRemoteImpl implements ClientRemote {
	private PublisherImpl publisher;
	private DataWriterImpl dataw;

	public void createPublisher(Subscriber suscriber) {
		publisher = new PublisherImpl();
		publisher.addSubscriber(suscriber);
	}

	public DataWriter buildDataWriter(Publisher publisher) {
		dataw = new DataWriterImpl(publisher);
		return dataw;
	}

	public void writeOperation(String topicName, Operation operation) {
		dataw.write(topicName, operation);
	}
}
